/**
 * @Time    : 2022/03/09 15:43
 * @Author  : WanRongJia
 * @License : Software business license
 * @Site    : www.linshensjl.top
 * @File    : validateResult.js
 * @Software: Rich Web Platform
 * @Function: 验证 返回
 * @Version : 1.0
 **/
const { validationResult } = require('express-validator')

const validateResult = function (req, res, next) {
    try {
        validationResult(req).throw()
        return next()
    } catch (err) {
        return res.status(200).json(err)
    }
};

module.exports = { validateResult }